package org.lwz.space.service.impl;

import org.lwz.space.dao.ArticleDao;
import org.lwz.space.dao.ArticleTypeDao;
import org.lwz.space.dao.UserDao;
import org.lwz.space.model.Article;
import org.lwz.space.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Liaowz on 2015/10/16.
 */
@Service("articleService")
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleDao articleDao;

    @Autowired
    private ArticleTypeDao articleTypeDao;

    @Autowired
    private UserDao userDao;


    @Override
    public void save(Article article) {

        this.articleDao.save(article);
    }

    @Override
    public List<Article> list() {
        return this.articleDao.list();
    }

    @Override
    public void update(Article article) {
        this.articleDao.update(article);
    }

    @Override
    public Article getArticle(Integer id) {
        return articleDao.get(id);

    }

    @Override
    public void delete(Integer id) {
        articleDao.delete(id);
    }
}
